package com.sq.partner.manager.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.sq.partner.manager.dao.IGatewayRoleDao;
import com.sq.partner.manager.dao.IGatewayRoleMenuDao;
import com.sq.partner.manager.mybatis.model.GatewayRoleMenu;

@Repository
public class GatewayRoleMenuDaoImpl extends BaseDaoImpl implements IGatewayRoleMenuDao {


	@Override
	public boolean addMenusForRole(GatewayRoleMenu roleMenu) throws Exception {
		return this.add("insertGatewayRoleMenu", roleMenu);
	}

	@Override
	public boolean delMenusForRole(Long roleId) throws Exception {
		return this.delete("delGatewayRoleMenuByRoleId", roleId);
	}
	
	@Override
	public boolean delMenusForMenu(Long menuId) throws Exception {
		return this.delete("delGatewayRoleMenuByMenuId", menuId);
	}

	@Override
	public List<GatewayRoleMenu> queryAllMenusOfCurRole(GatewayRoleMenu rm)
			throws Exception {
		return this.queryList("queryAllGatewayRoleMenu", rm);
	}
}
